// 满减相关
import request,{Method} from '@/libs/api.js'

// 添加满减活动
export function addFullDiscount (params) {
    return request({
      url: '/coupon/fulldiscount/addFullDiscount',
      method: Method.POST,
      data: params
    });
}

// 获取满减活动的分页数据
export function getSellerFullDiscountPage (params) {
    return request({
      url: '/coupon/fulldiscount/getSellerFullDiscountPage',
      method: Method.POST,
      data: params
    });
}

// 根据传入的ID获取满减活动的详情
export function getFullDiscountDetail(id){
    return request({
        url : `/coupon/fulldiscount/getFullDiscountDetail/${id}`,
        method: Method.GET,
    })
}

// 修改满减活动
export function editFullDiscount (params) {
    return request({
      url: '/coupon/fulldiscount/editFullDiscount',
      method: Method.POST,
      data: params
    });
}

// 关闭满减活动
export function closeFullDiscount(id){
    return request({
        url : `/coupon/fulldiscount/closeFullDiscount/${id}`,
        method: Method.PUT,
    })
}

// 修改满减活动
export function openFullDiscount (params) {
    return request({
      url: '/coupon/fulldiscount/openFullDiscount',
      method: Method.PUT,
      data: params
    });
}

// 删除满减活动
export function deleteFullDiscount(id){
    return request({
        url : `/coupon/fulldiscount/deleteFullDiscount/${id}`,
        method: Method.DELETE,
    })
}